<template>
	<view v-if="contractList.length" class="service-wrapper">
		<!-- 服务简述 -->
		<view class="service-simple" @click="handlePopup">
			<view class="s-list">
				<view class="s-item" v-for="(item, index) in contractList" :key="index">
					<text class="item-icon iconfont icon-fuwu"></text>
					<text class="item-val">{{ item.contract_name }}</text>
				</view>
			</view>
			<!-- 扩展箭头 -->
			<view class="s-arrow f-26 col-9 t-r">
				<text class="iconfont icon-arrow-right"></text>
			</view>
		</view>
		<!-- 详情内容弹窗 -->
		<u-popup v-model="showPopup" :show="showPopup" mode="bottom" :closeable="true" @close="close"
			:border-radius="26">
			<view class="service-content">
				<view class="title">服务</view>
				<scroll-view class="content-scroll" :scroll-y="true">
					<view class="s-list clearfix">
						<view class="s-item" v-for="(item, index) in contractList" :key="index">
							<text class="item-icon iconfont icon-fuwu"></text>
							<view class="item-val">{{ item.contract_name }}</view>
							<view class="item-summary">{{ item.contract_desc }}</view>
						</view>
					</view>
				</scroll-view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	export default {
		props: {
			// 商品IDL
			contractList: {
				type: Array,
				default () {
					return []
				}
			}
		},
		data() {
			return {
				// 正在加载
				isLoading: true,
				// 显示详情内容弹窗
				showPopup: false,
			}
		},

		created() {},

		methods: {
			// 显示弹窗
			handlePopup() {
				this.showPopup = !this.showPopup
			},
			close() {
				this.showPopup = false
				// console.log('close');
			}

		}
	}
</script>

<style lang="scss" scoped>
	.service-wrapper {
		min-height: 24rpx;
		margin-bottom: -24rpx;
	}

	// 服务简述
	.service-simple {
		padding: 24rpx 30rpx;
		display: flex;
		align-items: center;

		.s-list {
			flex: 1;
			margin-left: -15rpx;
		}

		.s-item {
			float: left;
			font-size: 26rpx;
			margin: 8rpx 15rpx;

			.item-icon {
				color: #FA2209;
			}

			.item-val {
				margin-left: 12rpx;
			}
		}


	}

	// 服务详细内容
	.service-content {
		padding: 24rpx;

		.title {
			font-size: 30rpx;
			margin-bottom: 50rpx;
			font-weight: bold;
			text-align: center;
		}

		.content-scroll {
			min-height: 400rpx;
			max-height: 760rpx;
		}

		.s-list {
			padding: 0 30rpx 0 80rpx;
		}

		.s-item {
			position: relative;
			margin-bottom: 60rpx;

			.item-icon {
				position: absolute;
				top: 6rpx;
				left: -50rpx;
				color: #FA2209;
			}

			.item-val {
				font-size: 28rpx;
			}

			.item-summary {
				font-size: 26rpx;
				margin-top: 20rpx;
				color: #6d6d6d;
			}
		}

	}
</style>
